
setwd("/Pub/Users/wangyk/project/Poroject/P220215002_F210806004_TNBC_Necroptosis/0.data_prepare")


# GSE116918-------
source("/Pub/Users/wangyk/Project_wangyk/Codelib_YK/CY_code/get_map.R")
source("/Pub/Users/wangyk/Project_wangyk/Codelib_YK/CY_code/exp_martix_aggregate.R")
gse <- getGEO(GEO = "GSE116918", destdir = output_dir, GSEMatrix = TRUE)
geo_exp <- exprs(gse[[1]])
geo_pdata <- pData(gse[[1]])

probe <- getGEO(filename = "/Pub/Data/Data_Center/easyGEO/2021-11-01/03_Annotation/GPL25nnn/GPL25318.annotation.soft")

map_infor <- probe@dataTable@table %>%
    as.data.frame() %>%
    select(ID, `Ensembl Gene ID`) %>%
    rename(ID = 1, Ensembl = 2)

gene_map <- get_map()

test <- geo_exp %>%
    as.data.frame() %>%
    rownames_to_column("ID") %>%
    inner_join(map_infor, .) %>%
    inner_join(., gene_map[, c("id", "gene_name")], by = c(Ensembl = "id")) %>%
    select(-ID, -Ensembl) %>%
    exp_martix_aggregate(input_exp = ., rownames_type = "gene_name")

exprs_SYMBOL <- log2(test + 1)



list.files(path = "/Pub/Data/Data_Center/easyGEO/2021-11-01/03_Annotation/", pattern = "",
    full.names = T, recursive = T)
